'use strict';

/**
 * @ngdoc function
 * @name passwordAgentApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the passwordAgentApp
 */
angular.module('passwordAgentApp')
  .controller('AlertCtrl',['$scope','$rootScope','alertService', function ($scope,$rootScope,alertService) {
    console.log("AlertCtrl");
    //$rootScope.alerts = [
    //  { type: 'error', msg: 'Oh snap! Change a few things up and try submitting again.' },
    //  { type: 'success', msg: 'Well done! You successfully read this important alert message.' }
    //];

    //$rootScope.addAlert = function() {
    //  $rootScope.alerts.push({msg: "Another alert!"});
    //};

    $rootScope.closeAlert = function(index) {
      $rootScope.alerts.splice(index, 1);
    };
    //$scope.closeAlert = alertService.closeAlertIdx;

  }]);
